package com.xtianzhuang.www.controller.common;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xtianzhuang.www.controller.BaseController;
import com.xtianzhuang.www.entity.constants.CodeConstants;
import com.xtianzhuang.www.entity.request.GetFormatStringRequest;
import com.xtianzhuang.www.entity.response.GetFormatStringResponse;
import com.xtianzhuang.www.utils.JsonFormatUtil;

@Controller
@RequestMapping("/common")
public class CommonController extends BaseController {

	@RequestMapping(value = "/getFormatString")
	@ResponseBody
	public GetFormatStringResponse queryDailyBalanceStatistics(GetFormatStringRequest request) {
		GetFormatStringResponse response = new GetFormatStringResponse();
		if (request.getType().equals("1")) {
			String retString = JsonFormatUtil.formatJson(request.getStr().trim());
			response.setStr(retString);
		}
		response.setCode(CodeConstants.SUCCESS);
		response.setMessage("查询成功");
		return response;
	}
}
